package org.t236.user;

import com.alibaba.csp.sentinel.annotation.SentinelResource;
import com.alibaba.csp.sentinel.slots.block.BlockException;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.stereotype.Service;
import org.t236.dubbo.user.UserServiceDubboApi;

//@Service
@DubboService
public class UserServiceImpl implements UserServiceDubboApi {
    @Override
    @SentinelResource(value = "helloDubbo", blockHandler = "blockHandler")
    public String hello(String name) {
        return "DUBBO Hello " + name;
    }

    public String blockHandler(String name, BlockException ex) {
        return "UserServiceImpl.hello被限流了：" + name + ":" + ex;
    }
}
